#!/usr/bin/perl  
#  Script: seek_with_read_write 
open(FH, "+>joker") || die; # joker is opened for reading and writing 
print FH "This line is written to joker.\n"; 
seek(FH,0,0); # goto the beginning of the file 
while(<FH>) { 
print; # reads from joker; the line is in $_ 
}  
